<template>
  <el-config-provider :size="size" :locale="locale">
    <!-- 开启水印 -->
    <el-watermark v-if="watermarkEnabled" :font="{ color: fontColor }" :zIndex="9999"
      :content="defaultSettings.watermarkContent" class="wh-full">
      <router-view />
    </el-watermark>
    <!-- 关闭水印 -->
    <router-view v-else />
  </el-config-provider>
</template>
<script setup lang="ts">
import { SizeEnum } from "./enums/SizeEnum";
import defaultSettings from "@/settings";
import { useAppStore, useSettingsStore } from "./store";
const appStore = useAppStore();
const settingsStore = useSettingsStore();
const size = computed(() => appStore.size as SizeEnum);
const locale = computed(() => appStore.locale);
const watermarkEnabled = computed(() => settingsStore.watermarkEnabled);

// 明亮/暗黑主题水印字体颜色适配
const fontColor = computed(() => {
  // return settingsStore.theme === ThemeEnum.DARK
  //   ? "rgba(255, 255, 255, .15)"
  //   : "rgba(0, 0, 0, .15)";
  return "rgba(0, 0, 0, .15)";
});
</script>

<style>
.wh-full {
  width: 100%;
  height: 100%;
}
</style>
